<html>
<head><meta charset="utf-8"><title>MutationUse and NonMutatingUse in visitor · t-compiler/wg-mir-opt · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/index.html">t-compiler/wg-mir-opt</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/MutationUse.20and.20NonMutatingUse.20in.20visitor.html">MutationUse and NonMutatingUse in visitor</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="167606709"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/MutationUse%20and%20NonMutatingUse%20in%20visitor/near/167606709" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/MutationUse.20and.20NonMutatingUse.20in.20visitor.html#167606709">(Jun 07 2019 at 19:34)</a>:</h4>
<p><span class="user-mention" data-user-id="124288">@oli</span> as we were discussing</p>



<a name="167606830"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/MutationUse%20and%20NonMutatingUse%20in%20visitor/near/167606830" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/MutationUse.20and.20NonMutatingUse.20in.20visitor.html#167606830">(Jun 07 2019 at 19:36)</a>:</h4>
<p>the <code>context</code> thing that happens here <a href="https://github.com/rust-lang/rust/blob/master/src/librustc_codegen_ssa/mir/analyze.rs" target="_blank" title="https://github.com/rust-lang/rust/blob/master/src/librustc_codegen_ssa/mir/analyze.rs">https://github.com/rust-lang/rust/blob/master/src/librustc_codegen_ssa/mir/analyze.rs</a> is kind of weird to me</p>



<a name="167606857"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/MutationUse%20and%20NonMutatingUse%20in%20visitor/near/167606857" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/MutationUse.20and.20NonMutatingUse.20in.20visitor.html#167606857">(Jun 07 2019 at 19:36)</a>:</h4>
<p>look at <a href="https://github.com/rust-lang/rust/blob/master/src/librustc_codegen_ssa/mir/analyze.rs#L163-L166" target="_blank" title="https://github.com/rust-lang/rust/blob/master/src/librustc_codegen_ssa/mir/analyze.rs#L163-L166">https://github.com/rust-lang/rust/blob/master/src/librustc_codegen_ssa/mir/analyze.rs#L163-L166</a></p>



<a name="167606860"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/MutationUse%20and%20NonMutatingUse%20in%20visitor/near/167606860" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/MutationUse.20and.20NonMutatingUse.20in.20visitor.html#167606860">(Jun 07 2019 at 19:36)</a>:</h4>
<p>and then</p>



<a name="167606870"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/MutationUse%20and%20NonMutatingUse%20in%20visitor/near/167606870" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/MutationUse.20and.20NonMutatingUse.20in.20visitor.html#167606870">(Jun 07 2019 at 19:36)</a>:</h4>
<p><a href="https://github.com/rust-lang/rust/blob/master/src/librustc_codegen_ssa/mir/analyze.rs#L201-L205" target="_blank" title="https://github.com/rust-lang/rust/blob/master/src/librustc_codegen_ssa/mir/analyze.rs#L201-L205">https://github.com/rust-lang/rust/blob/master/src/librustc_codegen_ssa/mir/analyze.rs#L201-L205</a></p>



<a name="167606909"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/MutationUse%20and%20NonMutatingUse%20in%20visitor/near/167606909" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/MutationUse.20and.20NonMutatingUse.20in.20visitor.html#167606909">(Jun 07 2019 at 19:36)</a>:</h4>
<p>the thing is going to match at most the first time and never again</p>



<a name="167606936"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/MutationUse%20and%20NonMutatingUse%20in%20visitor/near/167606936" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/MutationUse.20and.20NonMutatingUse.20in.20visitor.html#167606936">(Jun 07 2019 at 19:37)</a>:</h4>
<p>if that's the intention I guess at least that shouldn't be inside the loop</p>



<a name="167606956"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/MutationUse%20and%20NonMutatingUse%20in%20visitor/near/167606956" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/MutationUse.20and.20NonMutatingUse.20in.20visitor.html#167606956">(Jun 07 2019 at 19:37)</a>:</h4>
<p>I've changed that code to make iterative, maybe I was the one that the wrong thing :P</p>



<a name="167607084"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/MutationUse%20and%20NonMutatingUse%20in%20visitor/near/167607084" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/MutationUse.20and.20NonMutatingUse.20in.20visitor.html#167607084">(Jun 07 2019 at 19:38)</a>:</h4>
<p>well, not the first time, is true that there's a <code>continue</code></p>



<a name="167607098"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/MutationUse%20and%20NonMutatingUse%20in%20visitor/near/167607098" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/MutationUse.20and.20NonMutatingUse.20in.20visitor.html#167607098">(Jun 07 2019 at 19:38)</a>:</h4>
<p>hmm the code is a bit weird to me</p>



<a name="167607172"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/MutationUse%20and%20NonMutatingUse%20in%20visitor/near/167607172" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/MutationUse.20and.20NonMutatingUse.20in.20visitor.html#167607172">(Jun 07 2019 at 19:39)</a>:</h4>
<p>also, I'm just seeing this <a href="https://github.com/rust-lang/rust/blob/master/src/librustc_codegen_ssa/mir/analyze.rs#L192-L199" target="_blank" title="https://github.com/rust-lang/rust/blob/master/src/librustc_codegen_ssa/mir/analyze.rs#L192-L199">https://github.com/rust-lang/rust/blob/master/src/librustc_codegen_ssa/mir/analyze.rs#L192-L199</a> too</p>



<a name="167607189"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/MutationUse%20and%20NonMutatingUse%20in%20visitor/near/167607189" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/MutationUse.20and.20NonMutatingUse.20in.20visitor.html#167607189">(Jun 07 2019 at 19:39)</a>:</h4>
<p>so inside the iteration we have a recursion</p>



<a name="167607513"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/MutationUse%20and%20NonMutatingUse%20in%20visitor/near/167607513" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/MutationUse.20and.20NonMutatingUse.20in.20visitor.html#167607513">(Jun 07 2019 at 19:43)</a>:</h4>
<p>first, I'm removing this <a href="https://github.com/rust-lang/rust/blob/master/src/librustc_codegen_ssa/mir/analyze.rs#L192-L199" target="_blank" title="https://github.com/rust-lang/rust/blob/master/src/librustc_codegen_ssa/mir/analyze.rs#L192-L199">https://github.com/rust-lang/rust/blob/master/src/librustc_codegen_ssa/mir/analyze.rs#L192-L199</a></p>



<a name="167609831"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/MutationUse%20and%20NonMutatingUse%20in%20visitor/near/167609831" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/MutationUse.20and.20NonMutatingUse.20in.20visitor.html#167609831">(Jun 07 2019 at 20:10)</a>:</h4>
<p>just opened a PR <a href="https://github.com/rust-lang/rust/pull/61633" target="_blank" title="https://github.com/rust-lang/rust/pull/61633">https://github.com/rust-lang/rust/pull/61633</a></p>



<a name="167613541"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/MutationUse%20and%20NonMutatingUse%20in%20visitor/near/167613541" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/MutationUse.20and.20NonMutatingUse.20in.20visitor.html#167613541">(Jun 07 2019 at 21:02)</a>:</h4>
<p>hmm... is that really the same? The <code>visit_place</code> recursion essentially restarts the loop, right?</p>



<a name="167613570"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/MutationUse%20and%20NonMutatingUse%20in%20visitor/near/167613570" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/MutationUse.20and.20NonMutatingUse.20in.20visitor.html#167613570">(Jun 07 2019 at 21:02)</a>:</h4>
<p>after your change it continues the loop</p>



<a name="167613698"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/MutationUse%20and%20NonMutatingUse%20in%20visitor/near/167613698" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/MutationUse.20and.20NonMutatingUse.20in.20visitor.html#167613698">(Jun 07 2019 at 21:04)</a>:</h4>
<p>yep but it also has a return</p>



<a name="167613714"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/MutationUse%20and%20NonMutatingUse%20in%20visitor/near/167613714" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/MutationUse.20and.20NonMutatingUse.20in.20visitor.html#167613714">(Jun 07 2019 at 21:04)</a>:</h4>
<p>so it's the same</p>



<a name="167613739"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/MutationUse%20and%20NonMutatingUse%20in%20visitor/near/167613739" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/MutationUse.20and.20NonMutatingUse.20in.20visitor.html#167613739">(Jun 07 2019 at 21:05)</a>:</h4>
<p>it's calling the method again with base but having a return on it, so current recursion will stop and a new one starting with the next element would be created</p>



<a name="167613750"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/MutationUse%20and%20NonMutatingUse%20in%20visitor/near/167613750" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/MutationUse.20and.20NonMutatingUse.20in.20visitor.html#167613750">(Jun 07 2019 at 21:05)</a>:</h4>
<p>which is the same as just following to the next step of the recursion</p>



<a name="167613756"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/MutationUse%20and%20NonMutatingUse%20in%20visitor/near/167613756" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/MutationUse.20and.20NonMutatingUse.20in.20visitor.html#167613756">(Jun 07 2019 at 21:05)</a>:</h4>
<p>anyway, that's a thing in master</p>



<a name="167613769"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/MutationUse%20and%20NonMutatingUse%20in%20visitor/near/167613769" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/MutationUse.20and.20NonMutatingUse.20in.20visitor.html#167613769">(Jun 07 2019 at 21:05)</a>:</h4>
<p>not related to the problem we were trying to fix in the Place PR</p>



<a name="167614021"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/MutationUse%20and%20NonMutatingUse%20in%20visitor/near/167614021" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/MutationUse.20and.20NonMutatingUse.20in.20visitor.html#167614021">(Jun 07 2019 at 21:08)</a>:</h4>
<p>I'm not so sure, you're now using <code>proj.base</code>, so if you had <code>a -&gt; b -&gt; deref -&gt; c</code> it used to be <code>b</code>, <code>deref</code>, recurse, <code>b</code>, <code>a</code>, but now you changed it to <code>b</code>, <code>deref</code>, <code>c</code>, <code>a</code></p>



<a name="167614291"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/MutationUse%20and%20NonMutatingUse%20in%20visitor/near/167614291" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/MutationUse.20and.20NonMutatingUse.20in.20visitor.html#167614291">(Jun 07 2019 at 21:12)</a>:</h4>
<p>confused</p>



<a name="167614297"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/MutationUse%20and%20NonMutatingUse%20in%20visitor/near/167614297" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/MutationUse.20and.20NonMutatingUse.20in.20visitor.html#167614297">(Jun 07 2019 at 21:12)</a>:</h4>
<p>did you mean in the first example <code>c</code>, <code>deref</code>, recurse, <code>b</code>, <code>a</code>?</p>



<a name="167614318"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/MutationUse%20and%20NonMutatingUse%20in%20visitor/near/167614318" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/MutationUse.20and.20NonMutatingUse.20in.20visitor.html#167614318">(Jun 07 2019 at 21:13)</a>:</h4>
<p>no that's the recursive data structure: <code>c(deref(b(a)))</code></p>



<a name="167614336"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/MutationUse%20and%20NonMutatingUse%20in%20visitor/near/167614336" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/MutationUse.20and.20NonMutatingUse.20in.20visitor.html#167614336">(Jun 07 2019 at 21:13)</a>:</h4>
<p>which the iterator turns into <code>a</code>, <code>[b, deref, c]</code></p>



<a name="167614354"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/MutationUse%20and%20NonMutatingUse%20in%20visitor/near/167614354" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/MutationUse.20and.20NonMutatingUse.20in.20visitor.html#167614354">(Jun 07 2019 at 21:13)</a>:</h4>
<p>yes</p>



<a name="167614372"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/MutationUse%20and%20NonMutatingUse%20in%20visitor/near/167614372" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/MutationUse.20and.20NonMutatingUse.20in.20visitor.html#167614372">(Jun 07 2019 at 21:13)</a>:</h4>
<p>so when we are at the deref, proj.base is <code>b(a)</code></p>



<a name="167614440"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/MutationUse%20and%20NonMutatingUse%20in%20visitor/near/167614440" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/MutationUse.20and.20NonMutatingUse.20in.20visitor.html#167614440">(Jun 07 2019 at 21:14)</a>:</h4>
<p>so ... it seems like there may be some missing tests then</p>



<a name="167614450"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/MutationUse%20and%20NonMutatingUse%20in%20visitor/near/167614450" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/MutationUse.20and.20NonMutatingUse.20in.20visitor.html#167614450">(Jun 07 2019 at 21:14)</a>:</h4>
<p>maybe would be wise to check what the code did before my recurse to iterate change</p>



<a name="167614473"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/MutationUse%20and%20NonMutatingUse%20in%20visitor/near/167614473" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/MutationUse.20and.20NonMutatingUse.20in.20visitor.html#167614473">(Jun 07 2019 at 21:15)</a>:</h4>
<p>because with this PR and without this PR tests are ok</p>



<a name="167614749"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/MutationUse%20and%20NonMutatingUse%20in%20visitor/near/167614749" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/MutationUse.20and.20NonMutatingUse.20in.20visitor.html#167614749">(Jun 07 2019 at 21:19)</a>:</h4>
<p>well... these code changes would only show up in llvm IR I presume</p>



<a name="167614774"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/MutationUse%20and%20NonMutatingUse%20in%20visitor/near/167614774" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/MutationUse.20and.20NonMutatingUse.20in.20visitor.html#167614774">(Jun 07 2019 at 21:19)</a>:</h4>
<p>and probably just end up being less ideal code</p>



<a name="167614985"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/MutationUse%20and%20NonMutatingUse%20in%20visitor/near/167614985" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/MutationUse.20and.20NonMutatingUse.20in.20visitor.html#167614985">(Jun 07 2019 at 21:22)</a>:</h4>
<p>probably worth checking what did the code do before the iterate thing showed up then :)</p>



<a name="167614986"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/MutationUse%20and%20NonMutatingUse%20in%20visitor/near/167614986" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/MutationUse.20and.20NonMutatingUse.20in.20visitor.html#167614986">(Jun 07 2019 at 21:22)</a>:</h4>
<p>trying to do that</p>



<a name="167615011"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/MutationUse%20and%20NonMutatingUse%20in%20visitor/near/167615011" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/MutationUse.20and.20NonMutatingUse.20in.20visitor.html#167615011">(Jun 07 2019 at 21:22)</a>:</h4>
<p><a href="https://github.com/rust-lang/rust/blob/01cd907e3beef1c9d261c11c3d7171aa0f3cd54c/src/librustc_codegen_ssa/mir/analyze.rs" target="_blank" title="https://github.com/rust-lang/rust/blob/01cd907e3beef1c9d261c11c3d7171aa0f3cd54c/src/librustc_codegen_ssa/mir/analyze.rs">https://github.com/rust-lang/rust/blob/01cd907e3beef1c9d261c11c3d7171aa0f3cd54c/src/librustc_codegen_ssa/mir/analyze.rs</a></p>



<a name="167615167"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/MutationUse%20and%20NonMutatingUse%20in%20visitor/near/167615167" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/MutationUse.20and.20NonMutatingUse.20in.20visitor.html#167615167">(Jun 07 2019 at 21:25)</a>:</h4>
<p>hmm, you're right, both recursions should behave the same</p>



<a name="167615240"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/MutationUse%20and%20NonMutatingUse%20in%20visitor/near/167615240" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/MutationUse.20and.20NonMutatingUse.20in.20visitor.html#167615240">(Jun 07 2019 at 21:26)</a>:</h4>
<p>the old code was going straight from c to a</p>



<a name="167615254"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/MutationUse%20and%20NonMutatingUse%20in%20visitor/near/167615254" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/MutationUse.20and.20NonMutatingUse.20in.20visitor.html#167615254">(Jun 07 2019 at 21:26)</a>:</h4>
<p>which is what the code does after my PR</p>



<a name="167615263"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/MutationUse%20and%20NonMutatingUse%20in%20visitor/near/167615263" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/MutationUse.20and.20NonMutatingUse.20in.20visitor.html#167615263">(Jun 07 2019 at 21:26)</a>:</h4>
<p>the thing that master is doing right now, I have no clue :P</p>



<a name="167615267"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/MutationUse%20and%20NonMutatingUse%20in%20visitor/near/167615267" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/MutationUse.20and.20NonMutatingUse.20in.20visitor.html#167615267">(Jun 07 2019 at 21:26)</a>:</h4>
<p>really confusing</p>



<a name="167615306"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/MutationUse%20and%20NonMutatingUse%20in%20visitor/near/167615306" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/MutationUse.20and.20NonMutatingUse.20in.20visitor.html#167615306">(Jun 07 2019 at 21:27)</a>:</h4>
<p>yea, the old code went from the outermost projection (so the last one in iteration) to the innermost (so to the first one)</p>



<a name="167615384"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/MutationUse%20and%20NonMutatingUse%20in%20visitor/near/167615384" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/MutationUse.20and.20NonMutatingUse.20in.20visitor.html#167615384">(Jun 07 2019 at 21:28)</a>:</h4>
<p>and it had early aborts for zsts</p>



<a name="167615398"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/MutationUse%20and%20NonMutatingUse%20in%20visitor/near/167615398" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/MutationUse.20and.20NonMutatingUse.20in.20visitor.html#167615398">(Jun 07 2019 at 21:28)</a>:</h4>
<p><span aria-label="+1" class="emoji emoji-1f44d" role="img" title="+1">:+1:</span></p>



<a name="167615413"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/MutationUse%20and%20NonMutatingUse%20in%20visitor/near/167615413" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/MutationUse.20and.20NonMutatingUse.20in.20visitor.html#167615413">(Jun 07 2019 at 21:28)</a>:</h4>
<p>this is what happens now with the PR because we even visit base last <a href="https://github.com/rust-lang/rust/pull/61633/files#diff-e682b38b565035a82f29560c3b79144bR201" target="_blank" title="https://github.com/rust-lang/rust/pull/61633/files#diff-e682b38b565035a82f29560c3b79144bR201">https://github.com/rust-lang/rust/pull/61633/files#diff-e682b38b565035a82f29560c3b79144bR201</a></p>



<a name="167615415"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/MutationUse%20and%20NonMutatingUse%20in%20visitor/near/167615415" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/MutationUse.20and.20NonMutatingUse.20in.20visitor.html#167615415">(Jun 07 2019 at 21:28)</a>:</h4>
<p>hmm... maybe we should just replicate this recursion until we have slices and can reverse iterate?</p>



<a name="167615431"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/MutationUse%20and%20NonMutatingUse%20in%20visitor/near/167615431" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/MutationUse.20and.20NonMutatingUse.20in.20visitor.html#167615431">(Jun 07 2019 at 21:28)</a>:</h4>
<p>base was always visited last</p>



<a name="167615434"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/MutationUse%20and%20NonMutatingUse%20in%20visitor/near/167615434" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/MutationUse.20and.20NonMutatingUse.20in.20visitor.html#167615434">(Jun 07 2019 at 21:28)</a>:</h4>
<p>if at all</p>



<a name="167615437"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/MutationUse%20and%20NonMutatingUse%20in%20visitor/near/167615437" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/MutationUse.20and.20NonMutatingUse.20in.20visitor.html#167615437">(Jun 07 2019 at 21:28)</a>:</h4>
<p>yep</p>



<a name="167615449"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/MutationUse%20and%20NonMutatingUse%20in%20visitor/near/167615449" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/MutationUse.20and.20NonMutatingUse.20in.20visitor.html#167615449">(Jun 07 2019 at 21:28)</a>:</h4>
<p>what do you mean by replicate the recursion?</p>



<a name="167615455"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/MutationUse%20and%20NonMutatingUse%20in%20visitor/near/167615455" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/MutationUse.20and.20NonMutatingUse.20in.20visitor.html#167615455">(Jun 07 2019 at 21:29)</a>:</h4>
<p>to apply the PR?</p>



<a name="167615468"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/MutationUse%20and%20NonMutatingUse%20in%20visitor/near/167615468" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/MutationUse.20and.20NonMutatingUse.20in.20visitor.html#167615468">(Jun 07 2019 at 21:29)</a>:</h4>
<p>or is it something wrong in it and I'm not seeing it?</p>



<a name="167615469"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/MutationUse%20and%20NonMutatingUse%20in%20visitor/near/167615469" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/MutationUse.20and.20NonMutatingUse.20in.20visitor.html#167615469">(Jun 07 2019 at 21:29)</a>:</h4>
<p>Just create custom functions that do exactly what the old code did</p>



<a name="167615474"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/MutationUse%20and%20NonMutatingUse%20in%20visitor/near/167615474" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/MutationUse.20and.20NonMutatingUse.20in.20visitor.html#167615474">(Jun 07 2019 at 21:29)</a>:</h4>
<p>but have base and projection as separate arguments</p>



<a name="167615545"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/MutationUse%20and%20NonMutatingUse%20in%20visitor/near/167615545" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/MutationUse.20and.20NonMutatingUse.20in.20visitor.html#167615545">(Jun 07 2019 at 21:30)</a>:</h4>
<p>hmm oh wait, we don't have that yet -.-</p>



<a name="167615554"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/MutationUse%20and%20NonMutatingUse%20in%20visitor/near/167615554" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/MutationUse.20and.20NonMutatingUse.20in.20visitor.html#167615554">(Jun 07 2019 at 21:30)</a>:</h4>
<p>I'm mixing up the PRs</p>



<a name="167615575"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/MutationUse%20and%20NonMutatingUse%20in%20visitor/near/167615575" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/MutationUse.20and.20NonMutatingUse.20in.20visitor.html#167615575">(Jun 07 2019 at 21:30)</a>:</h4>
<p>so yea, we should revert the iterate change for that function, it silently changed behaviour and I'm not even sure how to properly test for it</p>



<a name="167615577"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/MutationUse%20and%20NonMutatingUse%20in%20visitor/near/167615577" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/MutationUse.20and.20NonMutatingUse.20in.20visitor.html#167615577">(Jun 07 2019 at 21:30)</a>:</h4>
<p>talking about this one <a href="https://github.com/rust-lang/rust/pull/61633" target="_blank" title="https://github.com/rust-lang/rust/pull/61633">https://github.com/rust-lang/rust/pull/61633</a></p>



<a name="167615601"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/MutationUse%20and%20NonMutatingUse%20in%20visitor/near/167615601" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/MutationUse.20and.20NonMutatingUse.20in.20visitor.html#167615601">(Jun 07 2019 at 21:31)</a>:</h4>
<p>oh yea, that transformation is wrong, but the code is wrong to begin with</p>



<a name="167615607"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/MutationUse%20and%20NonMutatingUse%20in%20visitor/near/167615607" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/MutationUse.20and.20NonMutatingUse.20in.20visitor.html#167615607">(Jun 07 2019 at 21:31)</a>:</h4>
<p>we can't do this in the <del>recursion</del> iteration way really</p>



<a name="167615608"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/MutationUse%20and%20NonMutatingUse%20in%20visitor/near/167615608" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/MutationUse.20and.20NonMutatingUse.20in.20visitor.html#167615608">(Jun 07 2019 at 21:31)</a>:</h4>
<p>eh</p>



<a name="167615626"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/MutationUse%20and%20NonMutatingUse%20in%20visitor/near/167615626" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/MutationUse.20and.20NonMutatingUse.20in.20visitor.html#167615626">(Jun 07 2019 at 21:31)</a>:</h4>
<p>we need to start with the outermost so we can early abort</p>



<a name="167615631"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/MutationUse%20and%20NonMutatingUse%20in%20visitor/near/167615631" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/MutationUse.20and.20NonMutatingUse.20in.20visitor.html#167615631">(Jun 07 2019 at 21:31)</a>:</h4>
<p>and do special things for immediates and derefs</p>



<a name="167615690"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/MutationUse%20and%20NonMutatingUse%20in%20visitor/near/167615690" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/MutationUse.20and.20NonMutatingUse.20in.20visitor.html#167615690">(Jun 07 2019 at 21:32)</a>:</h4>
<p>once we have slices, then we can replicate the current behaviour by recursing backwards</p>



<a name="167615708"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/MutationUse%20and%20NonMutatingUse%20in%20visitor/near/167615708" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/MutationUse.20and.20NonMutatingUse.20in.20visitor.html#167615708">(Jun 07 2019 at 21:33)</a>:</h4>
<p>hehe, everytime I come back to this I get confused</p>



<a name="167615711"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/MutationUse%20and%20NonMutatingUse%20in%20visitor/near/167615711" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/MutationUse.20and.20NonMutatingUse.20in.20visitor.html#167615711">(Jun 07 2019 at 21:33)</a>:</h4>
<p>iterate goes backwards</p>



<a name="167615714"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/MutationUse%20and%20NonMutatingUse%20in%20visitor/near/167615714" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/MutationUse.20and.20NonMutatingUse.20in.20visitor.html#167615714">(Jun 07 2019 at 21:33)</a>:</h4>
<p>right?</p>



<a name="167615726"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/MutationUse%20and%20NonMutatingUse%20in%20visitor/near/167615726" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/MutationUse.20and.20NonMutatingUse.20in.20visitor.html#167615726">(Jun 07 2019 at 21:33)</a>:</h4>
<p>well need to re-check the code to be honest I always forget</p>



<a name="167615731"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/MutationUse%20and%20NonMutatingUse%20in%20visitor/near/167615731" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/MutationUse.20and.20NonMutatingUse.20in.20visitor.html#167615731">(Jun 07 2019 at 21:33)</a>:</h4>
<p>iterate goes <code>a.b.c</code> in <code>b</code> -&gt; <code>c</code> and <code>a</code> can come howeveryou want</p>



<a name="167615782"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/MutationUse%20and%20NonMutatingUse%20in%20visitor/near/167615782" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/MutationUse.20and.20NonMutatingUse.20in.20visitor.html#167615782">(Jun 07 2019 at 21:34)</a>:</h4>
<p>recursion goes <code>c</code> -&gt; <code>b</code> -&gt; <code>a</code></p>



<a name="167615785"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/MutationUse%20and%20NonMutatingUse%20in%20visitor/near/167615785" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/MutationUse.20and.20NonMutatingUse.20in.20visitor.html#167615785">(Jun 07 2019 at 21:34)</a>:</h4>
<p>yes yes</p>



<a name="167615786"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/MutationUse%20and%20NonMutatingUse%20in%20visitor/near/167615786" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/MutationUse.20and.20NonMutatingUse.20in.20visitor.html#167615786">(Jun 07 2019 at 21:34)</a>:</h4>
<p>so it's wrong :)</p>



<a name="167618453"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/MutationUse%20and%20NonMutatingUse%20in%20visitor/near/167618453" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/MutationUse.20and.20NonMutatingUse.20in.20visitor.html#167618453">(Jun 07 2019 at 22:17)</a>:</h4>
<p><a href="https://github.com/rust-lang/rust/pull/61641" target="_blank" title="https://github.com/rust-lang/rust/pull/61641">https://github.com/rust-lang/rust/pull/61641</a></p>



<a name="167618459"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/MutationUse%20and%20NonMutatingUse%20in%20visitor/near/167618459" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/MutationUse.20and.20NonMutatingUse.20in.20visitor.html#167618459">(Jun 07 2019 at 22:17)</a>:</h4>
<p><span class="user-mention" data-user-id="124288">@oli</span> ^^^</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>